<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style scoped>
			p{
				line-height:150%;
			}
		</style>
	</head>
	<body>	
		<div id="tabs">	
		</div>
		<script type="text/javascript">
			
			$(function(){
				$('#tabs').tabs({
					fit:true,
					border:false,
					tabWidth:95,
					tabHeight:35,
					onSelect:function(title){
						//获得当前选中的tab
						var tab = $('#tabs').tabs('getSelected');
						//获得当前选中的tab 的href
						var url = $(tab.panel('options')).attr('href');
						tab.panel('refresh', url);
					}
				});
				$.get('interface',function(data){
						data.forEach(addTabs);
				},"json");
			})
			function addTabs(page){
				var index = page.indexOf("_");
				var ti = page.slice(0,index);		
				$('#tabs').tabs('add',{
					title: ti,
					border:false,
					selected: false,
					cache:true,
					href:page
				});
			}	
		</script>
	</body>
</html>
